package com.jk.controller;

import com.jk.entity.IntegralEntity;
import com.jk.entity.ItypeEntity;
import com.jk.entity.PeopleEntity;
import com.jk.service.IntegralService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("integral")
public class IntegralController {

    @Autowired
    private IntegralService integralService;
   /*
    * @Author 曾义才
    * @Description //TODO 查询
    * @Date 17:46 2021/4/21
    * @Param [integralEntity]
    * @return java.util.List<com.jk.entity.IntegralEntity>
    */
    @RequestMapping("query")
    public List<IntegralEntity> query(IntegralEntity integralEntity){
        return  integralService.query(integralEntity);
    }
    /*
     * @Author 曾义才
     * @Description //TODO 动态下拉框
     * @Date 17:46 2021/4/21
     * @Param []
     * @return java.util.List<com.jk.entity.ItypeEntity>
     */
    @RequestMapping("getType")
    public List<ItypeEntity> getType(){
        return  integralService.getType();
    }
    /*
     * @Author 曾义才
     * @Description //TODO 回显
     * @Date 17:46 2021/4/21
     * @Param [id]
     * @return com.jk.entity.IntegralEntity
     */
    @RequestMapping("gethui")
    public IntegralEntity gethui(Integer id){
        return  integralService.gethui(id);
    }
    /*
     * @Author 曾义才
     * @Description //TODO 修改
     * @Date 17:46 2021/4/21
     * @Param [integralEntity]
     * @return void
     */
    @RequestMapping("update")
    public void gethui(IntegralEntity integralEntity){
     integralService.update(integralEntity);
    }
    /*
     * @Author 曾义才
     * @Description //TODO 暂停
     * @Date 17:46 2021/4/21
     * @Param [id]
     * @return void
     */
    @RequestMapping("zan")
    public void zan(Integer id){
        integralService.zan(id);
    }
    /*
     * @Author 曾义才
     * @Description //TODO 删除
     * @Date 17:46 2021/4/21
     * @Param [id]
     * @return void
     */
    @RequestMapping("del")
    public void del(Integer id){
        integralService.del(id);
    }
    /*
     * @Author 曾义才
     * @Description //TODO 导出
     * @Date 17:46 2021/4/21
     * @Param [response]
     * @return void
     */
    @RequestMapping("poidaochu")
    public void poidaochu(HttpServletResponse response){
        integralService.poidaochu(response);
    }
 
   /*
    * @Author 曾义才
    * @Description //TODO 批量修改类型
    * @Date 17:47 2021/4/21
    * @Param [ids]
    * @return void
    */
    @RequestMapping("updall")
    public void updall( Integer[] ids, Integer lei){
        integralService.updall(ids,lei);
    }
    @RequestMapping("add")
    public void add(IntegralEntity integralEntity){
        integralService.add(integralEntity);
    }

  /*  @RequestMapping("daoru")
    public void daoru(MultipartFile file,HttpServletRequest request,HttpServletResponse response){
        integralService.daoru(file,request,response);
    }*/

    @RequestMapping("querypeople")
    public List<PeopleEntity> querypeople(HttpServletRequest request){
        return  integralService.querypeople(request);
    }

    @RequestMapping("queryGuan")
    public List<ItypeEntity> queryGuan(HttpServletRequest request){
        return  integralService.queryGuan(request);
    }


    @RequestMapping("addGuan")
    public void addGuan(ItypeEntity itypeEntity){
         integralService.addGuan(itypeEntity);
    }
    @RequestMapping("updateGuan")
    public void updateGuan(ItypeEntity itypeEntity){
         integralService.updateGuan(itypeEntity);
    }
    @RequestMapping("getGuan")
    public ItypeEntity getGuan(Integer tid){
        return  integralService.getGuan(tid);
    }
    @RequestMapping("delGuan")
    public void delGuan(Integer tid){
         integralService.delGuan(tid);
    }
    @RequestMapping("hui")
    public void hui(Integer id){
        integralService.hui(id);
    }

    @RequestMapping("queryZan")
    public List<IntegralEntity> queryZan(IntegralEntity integralEntity){
        return  integralService.queryZan(integralEntity);
    }
}
